home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / GRAPHICS / GMSMTH01.ZIP / TANK.C < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-28  |  1.9 KB  |  118 lines

  1. /*
  2.  
  3.     tank.c
  4.  
  5.     Internet: alexad3@icebox.iceonline.com
  6.     Copyright 1994, September 26 by Alec Russell, ALL rights reserved
  7.  
  8.     Created - 1994/9/26
  9.    Part of the 3D ball demo
  10.  
  11.     History:
  12.         New file
  13.  
  14. */
  15.  
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include <conio.h>
  20. #include <alloc.h>
  21. #include <dos.h>
  22. #include <time.h>
  23.  
  24. #include <pr2.h>
  25. #include <mode13.h>
  26. #include <readlbm.h>
  27. #include <fstring.h>
  28. #include <g_io.h>
  29. #include <gui.h>
  30. #include <erase.h>
  31. #include <die.h>
  32. #include <gmalloc.h>
  33.  
  34. #include <Xlib_all.h>
  35. #include "tank.h"
  36.  
  37.  
  38. /* ---------------------- add_path() ------------------ February 10,1995 */
  39. char *add_path(char *p)
  40. {
  41.    static char path[PATH_LEN];
  42.  
  43.    strcpy(path, gb_path);
  44.    strcat(path, p);
  45.  
  46.    return(path);
  47. }
  48.  
  49.  
  50. /* ---------------------- set_data_path() -------------- February 21,1994 */
  51. void set_data_path(char *p)
  52. {
  53.    strcpy(gb_path, p);
  54.    p=gb_path;
  55.    while ( *p++ )
  56.       ;
  57.  
  58.    while ( *p != '\\' )
  59.       p--;
  60.  
  61.    p++;
  62.    *p=0;
  63.  
  64.    strcat(gb_path, DATA_DIR);
  65.  
  66. }
  67.  
  68.  
  69.  
  70.  
  71.  
  72. /* ---------------------- main() --------------------- September 26,1994 */
  73. void main(int argc, char *argv[])
  74. {
  75.    short code;
  76.  
  77. clear_pr2();
  78.  
  79.    if ( argc > 1 )
  80.       {
  81.       pr2("argv[1] = %s", argv[1]);
  82.       }
  83.  
  84.    init_mem_list();
  85.    init_exit();
  86.    init_timer();
  87.  
  88.    randomize();
  89.  
  90.    init_xmode_video();
  91.  
  92.    // set gb_path
  93.    set_data_path(argv[0]);
  94.    init_events(add_path("crshair.cbm"));
  95.  
  96.    x_screen_fill(HiddenPageOffs, 0);
  97.    x_screen_fill(VisiblePageOffs, 0);
  98.  
  99.    /* set palette */
  100.    if ( load_palette(add_path("std.pal"), palette) )
  101.       {
  102.       die("error getting palette");
  103.       }
  104.    setvgapalette(palette);
  105.    
  106.    play();
  107.  
  108.    deinit_events();
  109.    deinit_xmode_video();
  110.    deinit_timer();
  111.  
  112.    
  113. }
  114.  
  115.  
  116. /* ------------------------------ EOF -------------------------------- */
  117.  
  118.